section .text
bits 16

	%define KERNEL_START_BASE 0x500

	org 0x7c00
	mov ax, 0
	mov ds, ax
	
	mov si, read_disk
	mov di, KERNEL_START_BASE
	mov ax, 1

read_disk:
        mov ah, 0               ; 重置驱动器
        int 13h                 
        or ah, ah                
        jnz read_disk           ; 失败则再次读取
        mov ax, 0                               
        mov es, ax                              
        mov bx, KERNEL_START_BASE

        mov ah, 0x02             ; 读磁盘
        mov al, 0x20            ; 扇区数
        mov ch, 0               
        mov cl, 2               ; 从第二扇区开始读取
        mov dh, 0               
	mov dl, 0
        int 13h             
        or ah, ah
	jnz  read_disk

	jmp KERNEL_START_BASE
	
times 510-($-$$) db 0
dw 0xaa55
	